<%@ page import="com.news.db.OpDB" %>
<%@ page import="com.news.model.News" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>新闻发布系统</title>
  </head>
  <body>
    <table border="0" width="700" height="500" cellspacing="0" cellpadding="0" align="right">
      <tr>
        <td align="center">
          <table border="1" width="690" height="480" cellspacing="0" cellpadding="0" rules="rows">
            <tr>
              <td align="center">
                <table border="0" cellpadding="0" cellspacing="0" width="685" href="475">
                  <tr>
                    <td colspan="2" rowspan="1"><font style="font-family:黑体;font-size:20px;">☞科技新闻☜</font></td>
                    <td><a href="view/IndexTemp.jsp?info_type=1&mainPage=newsinfo" >更多&gt;&gt;</a></td>
                  </tr>
                  <%
                    OpDB opdb = new OpDB();
                    ArrayList<News> keji = opdb.OpGetNews(1);
                    if(keji != null && keji.size() > 0){
                      for(int i=0;i<keji.size();i++){
                        News n= keji.get(i);
                  %>
                  <tr>
                    <td align="left"><a href="view/news_info.jsp?id=<%=n.getId()%>"><%=n.getInfo_title()%></a></td>
                    <td><%=n.getInfo_date()%></td>
                    <td><%=n.getInfo_creator()%></td>
                  </tr>
                  <%
                      }
                    }
                  %>

                  <tr>
                    <td colspan="2"><font style="font-family:黑体;font-size:20px;">☞游戏新闻☜</font></td>
                    <td><a href="view/IndexTemp.jsp?info_type=2&mainPage=newsinfo" >更多&gt;&gt;</a></td>
                  </tr>
                  <%
                    ArrayList<News> youxi = opdb.OpGetNews(2);
                    if(youxi != null && youxi.size() > 0){
                      for(int i=0;i<youxi.size();i++){
                        News n= youxi.get(i);
                  %>
                  <tr>
                    <td align="left"><a href="view/news_info.jsp?id=<%=n.getId()%>"><%=n.getInfo_title()%></a></td>
                    <td><%=n.getInfo_date()%></td>
                    <td><%=n.getInfo_creator()%></td>
                  </tr>
                  <tr>
                    <td></td>
                  </tr>
                  <%
                      }
                    }
                  %>

                  <tr>
                    <td colspan="2"><font style="font-family:黑体;font-size:20px;">☞房产新闻☜</font></td>
                    <td><a href="view/IndexTemp.jsp?info_type=3&mainPage=newsinfo" >更多&gt;&gt;</a></td>
                  </tr>
                  <%
                    ArrayList<News> fanchang = opdb.OpGetNews(3);
                    if(fanchang != null && fanchang.size() > 0){
                      for(int i=0;i<fanchang.size();i++){
                        News n= fanchang.get(i);
                  %>
                  <tr>
                    <td align="left"><a href="view/news_info.jsp?id=<%=n.getId()%>"><%=n.getInfo_title()%></a></td>
                    <td><%=n.getInfo_date()%></td>
                    <td><%=n.getInfo_creator()%></td>
                  </tr>
                  <%
                      }
                    }
                  %>

                  <tr>
                    <td colspan="2"><font style="font-family:黑体;font-size:20px;">☞财经新闻☜</font></td>
                    <td><a href="view/IndexTemp.jsp?info_type=4&mainPage=newsinfo" >更多&gt;&gt;</a></td>
                  </tr>
                  <%
                    ArrayList<News> caijing = opdb.OpGetNews(4);
                    if(caijing != null && caijing.size() > 0){
                      for(int i=0;i<caijing.size();i++){
                        News n= caijing.get(i);
                  %>
                  <tr>
                    <td align="left"><a href="view/news_info.jsp?id=<%=n.getId()%>"><%=n.getInfo_title()%></a></td>
                    <td><%=n.getInfo_date()%></td>
                    <td><%=n.getInfo_creator()%></td>
                  </tr>
                  <%
                      }
                    }
                  %>

                  <tr>
                    <td colspan="2" align="left"><font style="font-family:黑体;font-size:20px;">☞娱乐新闻☜</font></td>
                    <td><a href="view/IndexTemp.jsp?info_type=5&mainPage=newsinfo" >更多&gt;&gt;</a></td>
                  </tr>
                  <%
                    ArrayList<News> yule = opdb.OpGetNews(5);
                    if(yule != null && yule.size() > 0){
                      for(int i=0;i<yule.size();i++){
                        News n= yule.get(i);
                  %>
                  <tr>
                    <td align="left"><a href="view/news_info.jsp?id=<%=n.getId()%>"><%=n.getInfo_title()%></a></td>
                    <td align="left"><%=n.getInfo_date()%></td>
                    <td><%=n.getInfo_creator()%></td>
                  </tr>
                  <%
                      }
                    }
                  %>
                </table>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
  </body>
</html>